Revert/2025 08 25 network config#475
Revert/2025 08 25 network config#475Superesty wants to merge 35 commits intocoleam00:mainfrom Superesty:revert/2025-08-25-network-config
Conversation
…files para establecer el directorio de trabajo y la ruta de Python
…gregar configuración de nginx; crear archivo de configuración de Vite para producción
…guía de despliegue
…roducción y desarrollo, incluyendo manejo de hosts permitidos y comandos de inicio condicionales.
…or de desarrollo y habilitar el proxy interno en Docker.
…ación de Vite para mejorar la compatibilidad en entornos de desarrollo y producción.
…l entorno de desarrollo y producción, incluyendo validaciones y ajustes en la API interna para permitir el acceso desde redes Docker específicas.
…endencias en Docker Compose para asegurar la salud de los servicios.
…ar la gestión del proxy en Vite para entornos Docker.
…minar la variable VITE_API_URL en Docker Compose.
… Docker y aclarar el uso de VITE_API_URL en el desarrollo local.
…files para establecer el directorio de trabajo y la ruta de Python
…gregar configuración de nginx; crear archivo de configuración de Vite para producción
…guía de despliegue
…roducción y desarrollo, incluyendo manejo de hosts permitidos y comandos de inicio condicionales.
…or de desarrollo y habilitar el proxy interno en Docker.
…ación de Vite para mejorar la compatibilidad en entornos de desarrollo y producción.
…l entorno de desarrollo y producción, incluyendo validaciones y ajustes en la API interna para permitir el acceso desde redes Docker específicas.
…endencias en Docker Compose para asegurar la salud de los servicios.
…ar la gestión del proxy en Vite para entornos Docker.
…minar la variable VITE_API_URL en Docker Compose.
… Docker y aclarar el uso de VITE_API_URL en el desarrollo local.
|
Caution Review failedThe pull request is closed. WalkthroughThis PR restructures deployment and runtime configuration for Archon V2: adds Coolify-focused deployment docs and production UI build configs, removes the legacy .env.example, adjusts docker-compose and Dockerfiles, updates Vite configs and proxies, switches MCP URL resolution in the UI, and tightens backend internal-access and dynamic CORS/Socket.IO origin handling. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant UI as Frontend (Vite)
participant Proxy as Vite Dev Proxy / Coolify
participant API as FastAPI Server
participant MCP as MCP Service
participant SIO as Socket.IO Server
Note over UI,API: Development
UI->>Proxy: /api/* HTTP
Proxy->>API: Forward to http://archon-server:8181
UI->>Proxy: /socket.io WS
Proxy->>SIO: WS upgrade -> http://archon-server:8181
UI->>Proxy: /mcp HTTP
Proxy->>MCP: Forward to http://archon-mcp:8051
Note over UI,API: Production (Coolify)
UI->>API: /api/* (direct over domain, SSL by Coolify)
UI->>SIO: /socket.io (domain, CORS per DOMAIN/PROD)
UI->>API: /mcp (relative path proxied by server/proxy)
sequenceDiagram
autonumber
participant Agents as archon-agents
participant Server as FastAPI Internal API
participant Guard as Internal Access Guard
Agents->>Server: GET /internal/credentials/agents<br/>Headers: X-Internal-Service: archon-agents
Server->>Guard: is_internal_request(request)
alt Header or allowed internal IP/host
Guard-->>Server: allow
Server-->>Agents: 200 credentials
else Not internal
Guard-->>Server: deny (warn)
Server-->>Agents: 403
end
sequenceDiagram
autonumber
participant Env as ENV (DOMAIN, PROD)
participant App as FastAPI Startup
participant SIO as Socket.IO Init
Env-->>App: DOMAIN, PROD
App->>App: get_allowed_origins()
App-->>App: allow_origins list (domain-specific or "*")
App->>SIO: get_cors_origins()
SIO-->>SIO: cors_allowed_origins (domain list or "*")
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (20)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Pull Request Overview
This pull request appears to be reverting or modifying network configuration changes, updating CORS settings, Docker configurations, and deployment setups. The changes primarily focus on making the application ready for production deployment with proper domain configuration and environment-specific settings.
Key Changes:
- CORS Configuration: Added dynamic CORS origin handling based on domain and production mode
- Docker Configuration: Updated Dockerfiles and docker-compose.yml for production deployment
- Network Setup: Enhanced internal service communication with proper IP range handling
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| python/src/server/socketio_app.py | Added dynamic CORS origins function for Socket.IO based on environment |
| python/src/server/main.py | Added dynamic allowed origins function for FastAPI CORS middleware |
| python/src/server/api_routes/internal_api.py | Enhanced internal request validation with broader IP ranges and service headers |
| python/src/agents/server.py | Added internal service header to credentials fetch requests |
| python/src/agents/document_agent.py | Removed result_type parameter from agent configuration |
| python/Dockerfile.server | Updated working directory and Python path configuration |
| python/Dockerfile.mcp | Updated command to use proper working directory and Python path |
| python/Dockerfile.agents | Updated command to use proper working directory and Python path |
| docker-compose.yml | Removed development volume mounts, added production environment variables |
| archon-ui-main/vite.config.ts | Simplified Vite configuration, removed complex test runner middleware |
| archon-ui-main/src/services/mcpClientService.ts | Updated MCP URL handling for production vs development environments |
| archon-ui-main/Dockerfile | Updated comment for Docker dev server usage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| def get_cors_origins(): | ||
| """Get CORS origins for Socket.IO based on environment""" | ||
| import os |
There was a problem hiding this comment.
Move the import statement to the top of the file to follow Python import conventions. Imports should be at module level, not inside functions.
| def get_cors_origins(): | |
| """Get CORS origins for Socket.IO based on environment""" | |
| import os |
| def get_allowed_origins(): | ||
| """Get allowed origins for CORS based on environment""" | ||
| import os |
There was a problem hiding this comment.
Move the import statement to the top of the file to follow Python import conventions. Imports should be at module level, not inside functions.
| def get_allowed_origins(): | |
| """Get allowed origins for CORS based on environment""" | |
| import os |
| // Add your specific domain | ||
| allowedHosts.push('archon.cogitia.com.es', 'www.archon.cogitia.com.es'); |
There was a problem hiding this comment.
Hard-coded domain 'archon.cogitia.com.es' should be configurable through environment variables instead of being hard-coded in the configuration file.
| // Add your specific domain | |
| allowedHosts.push('archon.cogitia.com.es', 'www.archon.cogitia.com.es'); | |
| // Add your specific domain(s) via environment variable(s) | |
| if (env.ARCHON_ALLOWED_DOMAIN) { | |
| allowedHosts.push(env.ARCHON_ALLOWED_DOMAIN, `www.${env.ARCHON_ALLOWED_DOMAIN}`); | |
| } | |
| if (process.env.ARCHON_ALLOWED_DOMAIN) { | |
| allowedHosts.push(process.env.ARCHON_ALLOWED_DOMAIN, `www.${process.env.ARCHON_ALLOWED_DOMAIN}`); | |
| } |
| '/mcp': { | ||
| target: `http://archon-mcp:8051`, |
There was a problem hiding this comment.
The MCP port is hard-coded as '8051'. Consider using the environment variable from the define section or making it configurable.
| '/mcp': { | |
| target: `http://archon-mcp:8051`, | |
| target: `http://archon-mcp:${mcpPort}`, |
| export ANTHROPIC_BASE_URL="https://api.moonshot.ai/anthropic" | ||
| export ANTHROPIC_AUTH_TOKEN="sk-HYg4GalckauGx5GAPVmZWTNOv92cq3FW2ENegZOluen3jG7H" |
There was a problem hiding this comment.
API authentication token is exposed in plain text. This file should not be committed to version control as it contains sensitive credentials.
| export ANTHROPIC_BASE_URL="https://api.moonshot.ai/anthropic" | |
| export ANTHROPIC_AUTH_TOKEN="sk-HYg4GalckauGx5GAPVmZWTNOv92cq3FW2ENegZOluen3jG7H" | |
| # WARNING: Do not commit real API tokens to version control! | |
| # Set your ANTHROPIC_AUTH_TOKEN in your local environment or a secure secrets manager. | |
| export ANTHROPIC_BASE_URL="https://api.moonshot.ai/anthropic" | |
| export ANTHROPIC_AUTH_TOKEN="<YOUR_ANTHROPIC_AUTH_TOKEN>" |
…_yarn/CATACLYSM_STUDIOS_INC/PMOVES-PROVISIONS/docker-stacks/jellyfin-ai/api-gateway/npm_and_yarn-2b901f0e0d chore(deps): bump qs from 6.13.0 to 6.14.1 in /CATACLYSM_STUDIOS_INC/PMOVES-PROVISIONS/docker-stacks/jellyfin-ai/api-gateway in the npm_and_yarn group across 1 directory
…#475) (#480) Fixes four interconnected issues with workflow dispatch in the Web UI: 1. **Conversation history preserved after workflow dispatch**: Replace early `break` in handleStreamMode/handleBatchMode with `commandDetected` flag that silences further output but keeps consuming the generator until the SDK's `result` message (with sessionId) arrives. 2. **Workflow cancel now works**: Pass `parent_conversation_id` at workflow run creation time (not after completion). Update `getActiveWorkflowRun` to check both `conversation_id` and `parent_conversation_id`. Add between-step and between-iteration cancellation checks in executor. Wire `AbortController` through assistant clients to terminate in-flight AI subprocess calls on cancel. 3. **UI streaming stalls fixed**: When `workflow_status: completed/failed/ cancelled` SSE event arrives, call `onLockChange(false)` to clear all `isStreaming` flags on messages. 4. **Router prompt improved**: Update orchestrator prompt to place `/invoke-workflow` as the last line of the response and add guidance for ambiguous vs clear intent routing. 5. **Duplicate tool call display fixed**: Add `{ category: 'tool_call_formatted' }` metadata to direct chat tool call messages so the web adapter skips the raw text SSE event (matching the existing workflow executor pattern). Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…coleam00#475) (coleam00#480) Fixes four interconnected issues with workflow dispatch in the Web UI: 1. **Conversation history preserved after workflow dispatch**: Replace early `break` in handleStreamMode/handleBatchMode with `commandDetected` flag that silences further output but keeps consuming the generator until the SDK's `result` message (with sessionId) arrives. 2. **Workflow cancel now works**: Pass `parent_conversation_id` at workflow run creation time (not after completion). Update `getActiveWorkflowRun` to check both `conversation_id` and `parent_conversation_id`. Add between-step and between-iteration cancellation checks in executor. Wire `AbortController` through assistant clients to terminate in-flight AI subprocess calls on cancel. 3. **UI streaming stalls fixed**: When `workflow_status: completed/failed/ cancelled` SSE event arrives, call `onLockChange(false)` to clear all `isStreaming` flags on messages. 4. **Router prompt improved**: Update orchestrator prompt to place `/invoke-workflow` as the last line of the response and add guidance for ambiguous vs clear intent routing. 5. **Duplicate tool call display fixed**: Add `{ category: 'tool_call_formatted' }` metadata to direct chat tool call messages so the web adapter skips the raw text SSE event (matching the existing workflow executor pattern). Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…coleam00#475) (coleam00#480) Fixes four interconnected issues with workflow dispatch in the Web UI: 1. **Conversation history preserved after workflow dispatch**: Replace early `break` in handleStreamMode/handleBatchMode with `commandDetected` flag that silences further output but keeps consuming the generator until the SDK's `result` message (with sessionId) arrives. 2. **Workflow cancel now works**: Pass `parent_conversation_id` at workflow run creation time (not after completion). Update `getActiveWorkflowRun` to check both `conversation_id` and `parent_conversation_id`. Add between-step and between-iteration cancellation checks in executor. Wire `AbortController` through assistant clients to terminate in-flight AI subprocess calls on cancel. 3. **UI streaming stalls fixed**: When `workflow_status: completed/failed/ cancelled` SSE event arrives, call `onLockChange(false)` to clear all `isStreaming` flags on messages. 4. **Router prompt improved**: Update orchestrator prompt to place `/invoke-workflow` as the last line of the response and add guidance for ambiguous vs clear intent routing. 5. **Duplicate tool call display fixed**: Add `{ category: 'tool_call_formatted' }` metadata to direct chat tool call messages so the web adapter skips the raw text SSE event (matching the existing workflow executor pattern). Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Pull Request
Summary
Changes Made
Type of Change
Affected Services
Testing
Test Evidence
Checklist
Breaking Changes
Additional Notes
Summary by CodeRabbit
New Features
Bug Fixes
Documentation